<div id="content-header">
    <?php
    $this->widget('bootstrap.widgets.TbBreadcrumbs', array(
        'links' => array('Cấu hình website'),
        'htmlOptions' => array('id' => 'breadcrumb')
    ));
    ?>
</div>
<?php
$form = $this->beginWidget('CActiveForm', array(
    'enableAjaxValidation' => FALSE,
        ));
?>
<div class="button-bottom">
    <?php
    echo CHtml::ajaxSubmitButton('Cập nhật giá trị', array('admin/ajax', 'act' => 'doValue'), array('success' => 'reloadGrid'), array('class' => 'btn btn-success'));
    ?>
</div>
<div class="widget-box">
    <div class="widget-content nopadding">

        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">


            <?php
            $this->widget('bootstrap.widgets.TbGridView', array(
                'id' => 'setting-grid',
                'dataProvider' => $model->search(),
//    'filter' => $model,
                'selectableRows' => 2,
                'columns' => array(
                    array(
                        'name' => 'name',
                        'value' => '$data->name',
                        'type' => 'raw',
                        'filter' => FALSE,
                        'htmlOptions' => array('style' => 'width:20%'),
                    ),
                    array(
                        'name' => 'value',
                        'value' => '($data->field==0)?CHtml::textField("setValue[$data->id]",$data->value,array("class"=>"span8")):
                            CHtml::textArea("setValue[$data->id]",$data->value,array("class"=>"span8"))',
                        'type' => 'raw',
                        'filter' => FALSE,
                    ),
                ),
            ));
            ?>
            <script>
                function reloadGrid(data) {
                    $.fn.yiiGridView.update('setting-grid');
                }
            </script>

            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>